package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Article entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_ARTICLE", schema = "HCD_DEV")
public class Article extends Entity implements java.io.Serializable {

	// Fields

	private Long articleId;
	private Category category;
	private Long storeId;
	private String title;
	private String summary;
	private String body;
	private Integer status;
	private Integer click;
	private Long addTime;
	private Long updateTime;

	// Constructors

	/** default constructor */
	public Article() {
	}

	/** full constructor */
	public Article(Category category, Long storeId, String title, String summary, String body,
			Integer status, Integer click, Long addTime, Long updateTime) {
		this.category = category;
		this.storeId = storeId;
		this.title = title;
		this.summary = summary;
		this.body = body;
		this.status = status;
		this.click = click;
		this.addTime = addTime;
		this.updateTime = updateTime;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_ARTICLE")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "ARTICLE_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getArticleId() {
		return this.articleId;
	}

	public void setArticleId(Long articleId) {
		this.articleId = articleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CAT_ID", nullable = false)
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "STORE_ID", nullable = false, precision = 15, scale = 0)
	public Long getStoreId() {
		return this.storeId;
	}

	public void setStoreId(Long storeId) {
		this.storeId = storeId;
	}

	@Column(name = "TITLE", nullable = false, length = 200)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "SUMMARY", nullable = false, length = 400)
	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(name = "BODY", nullable = false)
	public String getBody() {
		return this.body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	@Column(name = "STATUS", nullable = false, precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "CLICK", nullable = false, precision = 8, scale = 0)
	public Integer getClick() {
		return this.click;
	}

	public void setClick(Integer click) {
		this.click = click;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

}